<template>
  <div style="padding:0.3rem 0.6rem" @click="selectSlideUp2">
    <div class="IntelligentClassification">
      <div class="yx-condition clearfix">
        <div class="yx-form-item clearfix">
          <div class="yx-form-inline">
            <label class="yx-form-label">库存大类</label>
            <div class="yx-form-ul">
              <div class="delete" v-show="query_get_item_big_class_input_delete"
                   @click="inputClear('query_get_item_big_class_input')">X
              </div>
              <input type="text" v-model="query_get_item_big_class_input"
                     @click.stop="selectClick('query_get_item_big_class')">
              <transition name="fade">
                <div class="yx-form-inner-list" v-show="query_get_item_big_class">
                  <li v-for="item in query_get_item_big_classData"
                      @click="choose_get_item_big_classFun(item.name,item.value)">
                    <nobr>{{item.value}} {{item.name}}</nobr>
                  </li>
                  <!--<li v-show="query_get_item_big_classData.length==0" @click="choose_get_item_big_classFun('','')">空
                  </li>-->
                </div>
              </transition>
            </div>
          </div>
          <div class="yx-form-inline" :class="{'yx-cur': disabledInput}">
            <label class="yx-form-label">库存小类</label>
            <div class="yx-form-ul">
              <div class="delete" v-show="query_get_item_small_class_input_delete"
                   @click="inputClear('query_get_item_small_class_input')">X
              </div>
              <input type="text" v-model="query_get_item_small_class_input"
                     @click.stop="selectClick('query_get_item_small_class')" v-bind:disabled="disabledInput">
              <transition name="fade">
                <div class="yx-form-inner-list" v-show="query_get_item_small_class">
                  <li v-for="item in query_get_item_small_classData"
                      @click="choose_get_item_small_classFun(item.name,item.value)">
                    <nobr>{{item.value}} {{item.name}}</nobr>
                  </li>
                  <!--<li v-show="query_get_item_small_classData.length==0" @click="choose_get_item_small_classFun('','')">
                    空
                  </li>-->
                </div>
              </transition>
            </div>
          </div>
          <div class="yx-form-inline">
            <label class="yx-form-label">物料编号</label>
            <div class="yx-form-ul">
              <div class="delete" v-show="query_get_item_input_delete" @click="inputClear('query_get_item_input')">X</div>
              <input type="text" v-model="query_get_item_input"
                     @click.stop="selectClick('query_get_item')">
              <transition name="fade">
                <div class="yx-form-inner-list" v-show="query_get_item">
                  <li v-for="item in query_get_itemData" @click="choose_get_itemFun(item.name,item.value)">
                    <nobr>{{item.name}}</nobr>
                  </li>
                  <!--<li v-show="query_get_itemData.length==0" @click="choose_get_itemFun('','')">
                    空
                  </li>-->
                </div>
              </transition>
            </div>
          </div>
          <div class="yx-form-inline">
            <label class="yx-form-label">计划类别</label>
            <div class="yx-form-ul">
              <div class="delete" v-show="query_get_plan_class_input_delete"
                   @click="inputClear('query_get_plan_class_input')">X
              </div>
              <input type="text" v-model="query_get_plan_class_input"
                     @click.stop="selectClick('query_get_plan_class')">
              <transition name="fade">
                <div class="yx-form-inner-list" v-show="query_get_plan_class">
                  <li v-for="item in query_get_plan_classData" @click="choose_get_plan_classFun(item.name,item.value)">
                    <nobr>{{item.name}}</nobr>
                  </li>
                  <!--<li v-show="query_get_plan_classData.length==0" @click="choose_get_plan_classFun('','')">
                    空
                  </li>-->
                </div>
              </transition>
            </div>
          </div>
          <div class="yx-form-inline">
            <label class="yx-form-label">智能分类</label>
            <div class="yx-form-ul">
              <div class="delete" v-show="query_get_item_category_input_delete"
                   @click="inputClear('query_get_item_category_input')">X
              </div>
              <input type="text" v-model="query_get_item_category_input"
                     @click.stop="selectClick('query_get_item_category')" readonly>
              <transition name="fade">
                <div class="yx-form-inner-list" v-show="query_get_item_category">
                  <li v-for="item in query_get_item_categoryData"
                      @click="choose_query_get_item_categoryFun(item.name,item.value)">{{item.name}}
                  </li>
                  <!--<li v-show="query_get_item_categoryData.length==0" @click="query_get_item_categoryFun('')">
                    空
                  </li>-->
                </div>
              </transition>
            </div>
          </div>
          <div class="yx-form-inline">
            <label class="yx-form-label">采购员</label>
            <div class="yx-form-ul">
              <div class="delete" v-show="query_get_buyer_input_delete" @click="inputClear('query_get_buyer_input')">X</div>
              <input type="text" v-model="query_get_buyer_input"
                     @click.stop="selectClick('query_get_buyer')">
              <transition name="fade">
                <div class="yx-form-inner-list" v-show="query_get_buyer">
                  <li v-for="item in query_get_buyerData" @click="choose_query_get_buyerFun(item.name,item.value)">
                    <nobr>{{item.value}} {{item.name}}</nobr>
                  </li>
                 <!-- <li v-show="query_get_buyerData.length==0" @click="choose_query_get_buyerFun('','')">
                    空
                  </li>-->
                </div>
              </transition>
            </div>
          </div>
          <div class="yx-form-inline">
            <label class="yx-form-label">Sourcing</label>
            <div class="yx-form-ul">
              <div class="delete" v-show="query_get_sourcing_input_delete" @click="inputClear('query_get_sourcing_input')">X
              </div>
              <input type="text" v-model="query_get_sourcing_input"
                     @click.stop="selectClick('query_get_sourcing')">
              <transition name="fade">
                <div class="yx-form-inner-list" v-show="query_get_sourcing">
                  <li v-for="item in query_get_sourcingData"
                      @click="choose_query_get_sourcingFun(item.name,item.value)">
                    <nobr>{{item.value}} {{item.name}}</nobr>
                  </li>
                 <!-- <li v-show="query_get_sourcingData.length==0" @click="choose_query_get_sourcingFun('','')">
                    空
                  </li>-->
                </div>
              </transition>
            </div>
          </div>
          <div class="yx-form-inline">
            <label class="yx-form-label">计划员</label>
            <div class="yx-form-ul">
              <div class="delete" v-show="query_get_planner_input_delete" @click="inputClear('query_get_planner_input')">X
              </div>
              <input type="text" v-model="query_get_planner_input"
                     @click.stop="selectClick('query_get_planner')">
              <transition name="fade">
                <div class="yx-form-inner-list" v-show="query_get_planner">
                  <li v-for="item in query_get_plannerData" @click="choose_query_get_plannerFun(item.name,item.value)">
                    <nobr>{{item.value}} {{item.name}}</nobr>
                  </li>
                  <!--<li v-show="query_get_plannerData.length==0" @click="choose_query_get_plannerFun('','')">
                    空
                  </li>-->
                </div>
              </transition>
            </div>
          </div>
          <div class="yx-form-inline">
            <label class="yx-form-label">起始月份</label>
            <div class="yx-form-ul">
              <div class="delete ipt-clear" @click="clearDate1()">X</div>
              <input type="text" id="startDate" readonly>
            </div>
          </div>
          <div class="yx-form-inline">
            <label class="yx-form-label">结束月份</label>
            <div class="yx-form-ul">
              <div class="delete ipt-clear" @click="clearDate2()">X</div>
              <input type="text" id="endDate" readonly>
            </div>
          </div>
        </div>
        <div class="clearfix yx-marginRight30">
          <div class="fr">
            <button class="yx-btn-yellow" @click="queryFun()">查询</button>
            <button class="yx-btn-grey" @click="clearCondition()">重置</button>
          </div>
        </div>
      </div>
      <div class="yx-content">
        <div class="yx-widthP100 yx-table-auto" style="overflow: auto;">
        <table class="yx-table" style="width:27rem" v-show="!itemqueryIsLoading&&!itemqueryIsError">
          <tr>
            <th rowspan="2">物料</th>
            <th rowspan="2">描述</th>
            <th rowspan="2">智能分类</th>
            <th colspan="5">日均库存</th>
            <th colspan="3">需求满足率</th>
            <th colspan="3">年周转率</th>
            <th colspan="3">平均库龄</th>
            <th colspan="5">OPO未结数量</th>
          </tr>
          <tr>
            <th class="bgfff">实际金额</th>
            <th class="bgfff">优化金额</th>
            <th class="bgfff">实际数量</th>
            <th class="bgfff">优化数量</th>
            <th class="bgfff">优化比例</th>
            <th class="bgfff">实际</th>
            <th class="bgfff">优化</th>
            <th class="bgfff">优化比例</th>
            <th class="bgfff">实际</th>
            <th class="bgfff">优化</th>
            <th class="bgfff">优化比例</th>
            <th class="bgfff">实际</th>
            <th class="bgfff">优化</th>
            <th class="bgfff">优化比例</th>
            <th class="bgfff">实际金额</th>
            <th class="bgfff">优化金额</th>
            <th class="bgfff">实际数量</th>
            <th class="bgfff">优化数量</th>
            <th class="bgfff">优化比例</th>
          </tr>
          <tr class="cursor" v-for="(item,index) in feedback_item_queryData.items" v-bind:class="{'trClickActive':tableTrClick==(index+1)}" @click="feedback_item_query_TR(index+1,item.ITEM,item.SEGMENT1);">
            <td class="textClick">{{item.SEGMENT1}}</td>
            <td>{{item.DESCRIPTION}}</td>
            <td>{{item.CLASS|classCategory}}</td>
            <td>{{item.ACTUAL_VALUE | numberThousand}}</td>
            <td>{{item.PREDICT_VALUE | numberThousand}}</td>
            <td>{{item.ACTUAL_INVENTORY_QUANTITY | numberThousand}}</td>
            <td>{{item.PREDICT_INVENTORY_QUANTITY | numberThousand}}</td>
            <td>
              {{item.INVENTORY_QUANTITY_P | numberPercent}}
            </td>
            <td>{{item.ACTUAL_FULLFILLMENT | numberPercent}}</td>
            <td>{{item.PREDICT_FULLFILLMENT | numberPercent}}</td>
            <td>
              {{item.FULLFILLMENT_P|numberPercent}}
            </td>
            <td>{{item.ACTUAL_TURNOVER_RATIO|numberThousand}}</td>
            <td>{{item.PREDICT_TURNOVER_RATIO|numberThousand}}</td>
            <td>
              {{item.TURNOVER_P|numberPercent}}
            </td>
            <td>{{item.ACTUAL_LIFE_TIME | numberThousand}}</td>
            <td>{{item.PREDICT_LIFE_TIME | numberThousand}}</td>
            <td>
              {{item.LIFE_TIME_P|numberThousand}}</td>
            <td>{{item.ACTUAL_SPARK_VALUE | numberThousand}}</td>
            <td>{{item.PREDICT_SPARK_VALUE | numberThousand}}</td>
            <td>{{item.ACTUAL_SPARK_QUANTITY | numberThousand}}</td>
            <td>{{item.PREDICT_SPARK_QUANTITY | numberThousand}}</td>
            <td>
              {{item.OPO_P|numberPercent}}
            </td>
          </tr>
        </table>
        </div>
        <div class="table-tr" v-if="feedback_item_queryData.pages>1&&!itemqueryIsLoading&&!itemqueryIsError">
          <div class="pageturn">
            共
            <em>{{feedback_item_queryData.total | numberThousand}}</em>
            条，第
            <em>{{feedback_item_queryData.page | numberThousand}}</em>
            /
            <em>{{feedback_item_queryData.pages | numberThousand}}</em>
            页，跳转到第
            <input type="text" class="pageturn-ipt" v-model="iptPage" value=""/>
            页
            <span class="page-turn" v-on:click="feedback_item_queryFun(iptPage,feedback_item_queryData.page)">跳转</span>
            <span class="page-first" v-on:click="feedback_item_queryFun(1,feedback_item_queryData.page)">首页</span>
            <span class="page-up"
                  v-on:click="feedback_item_queryData.page>1?feedback_item_queryFun(feedback_item_queryData.page-1,feedback_item_queryData.page):''">上一页</span>
            <span class="page-down"
                  v-on:click="feedback_item_queryData.page<feedback_item_queryData.pages?feedback_item_queryFun(feedback_item_queryData.page+1,feedback_item_queryData.page):''">下一页</span>
            <span class="page-last"
                  v-on:click="feedback_item_queryFun(feedback_item_queryData.pages,feedback_item_queryData.page)">末页</span>
          </div>
        </div>
        <div class="loadingBox">
          <div class="loadding80" v-show="itemqueryIsLoading"></div>
          <div class="frame-noData" v-show="itemqueryIsError">暂无数据...</div>
        </div>
        <p class="yx-marginTop40 yx-fontSize22 yx-marginBottom24 certainClassName">物料：<span>{{this.certainItemName}}</span></p>
        <div class="figureChangeTab">
          <ul class="clearfix">
            <li class="fl" :class="{'figureChangeTabActive': configShow==1}" @click="configShow=1;feedback_inventory_queryFun()">月均库存</li>
            <li class="fl" :class="{'figureChangeTabActive': configShow==2}" @click="configShow=2;feedback_fullfillment_queryFun()">需求满足率</li>
            <li class="fl" :class="{'figureChangeTabActive': configShow==3}" @click="configShow=3;feedback_turnover_queryFun()">年周转率</li>
            <li class="fl" :class="{'figureChangeTabActive': configShow==4}" @click="configShow=4;feedback_lifetime_queryFun()">平均库龄</li>
            <li class="fl" :class="{'figureChangeTabActive': configShow==5}" @click="configShow=5;feedback_opo_queryFun()">OPO超期未结</li>
            <li class="fl" :class="{'figureChangeTabActive': configShow==6}" @click="configShow=6;feedback_lifetime_overviewFun();feedback_lifetime_categoryFun();">库龄结构分析</li>
          </ul>
        </div>
        <div v-show="configShow==1">
          <div class="yx-label yx-marginTop40">月均库存</div>
          <div class="yx-marginTop40 yx-cover" id="container_feedbackInventoryQuery"
               v-show="!feedbackInventoryIsLoading&&!feedbackInventoryIsError"></div>
          <div class="yx-marginTop40 loadingBox">
            <div class="loadding80" v-show="feedbackInventoryIsLoading"></div>
            <div class="frame-noData" v-show="feedbackInventoryIsError">暂无数据...</div>
          </div>
        </div>
        <div v-show="configShow==2">
          <div class="yx-label yx-marginTop40">需求满足率</div>
          <div class="yx-marginTop40 yx-cover" id="container_fullfillment"
               v-show="!fullfillmentIsLoading&&!fullfillmentIsError"></div>
          <div class="yx-marginTop40 loadingBox">
            <div class="loadding80" v-show="fullfillmentIsLoading"></div>
            <div class='frame-noData' v-show="fullfillmentIsError">暂无数据...</div>
          </div>
        </div>

        <div v-show="configShow==3">
          <div class="yx-label yx-marginTop40">年周转率</div>
          <div class="yx-marginTop40 yx-cover" id="container_turnover"
               v-show="!turnoverIsLoading&&!turnoverIsError"></div>
          <div class="yx-marginTop40 loadingBox">
            <div class="loadding80" v-show="turnoverIsLoading"></div>
            <div class="frame-noData" v-show="turnoverIsError">暂无数据...</div>
          </div>
        </div>

        <div v-show="configShow==4">
          <div class="yx-label yx-marginTop40">平均库龄</div>
          <div class="yx-marginTop40 yx-cover" id="container_lifetime"
               v-show="!lifetimeIsLoading&&!lifetimeIsError"></div>
          <div class="yx-marginTop40 loadingBox">
            <div class="loadding80" v-show="lifetimeIsLoading"></div>
            <div class="frame-noData" v-show="lifetimeIsError">暂无数据...</div>
          </div>
        </div>

        <div v-show="configShow==5">
          <div class="yx-label yx-marginTop40">OPO超期未结</div>
          <div class="yx-marginTop40 yx-cover" id="container_OPO" v-show="!opoIsLoading&&!opoIsError"></div>
          <div class="yx-marginTop40 loadingBox">
            <div class="loadding80" v-show="opoIsLoading"></div>
            <div class="frame-noData" v-show="opoIsError">暂无数据...</div>
          </div>
        </div>

        <div v-show="configShow==6">
          <div class="yx-label yx-marginTop40">库龄结构分析</div>
          <div class="clearfix" v-show="!lifetime_overviewIsLoading&&!lifetime_overviewIsError">
            <div class="fl yx-pie" id="containerBar"></div>
            <div class="yx-marginTop40 fr">
              <table class="yx-table yx-width1310">
                <colgroup>
                  <col width="20%">
                  <col width="20%">
                  <col width="20%">
                  <col width="20%">
                  <col width="20%">
                </colgroup>
                <tr>
                  <th>库龄</th>
                  <th>物料数量</th>
                  <th>数量占比</th>
                  <th>库存价值/元</th>
                  <th>价值占比</th>
                </tr>
                <tr>
                  <td><p class="yx-iboxP"><i class="yx-ibox bg-ffbe4c"></i> 30天以下</p></td>
                  <td>{{feedback_lifetime_overviewData_A.item_quantity | numberThousand}}</td>
                  <td>{{feedback_lifetime_overviewData_A.quantity_ratio | numberPercent}}</td>
                  <td>{{feedback_lifetime_overviewData_A.item_value | numberThousand}}</td>
                  <td>{{feedback_lifetime_overviewData_A.value_ratio | numberPercent}}</td>
                </tr>
                <tr>
                  <td><p class="yx-iboxP"><i class="yx-ibox bg-51d489"></i> 31-60天</p></td>
                  <td>{{feedback_lifetime_overviewData_B.item_quantity | numberThousand}}</td>
                  <td>{{feedback_lifetime_overviewData_B.quantity_ratio | numberPercent}}</td>
                  <td>{{feedback_lifetime_overviewData_B.item_value | numberThousand}}</td>
                  <td>{{feedback_lifetime_overviewData_B.value_ratio | numberPercent}}</td>
                </tr>
                <tr>
                  <td><p class="yx-iboxP"><i class="yx-ibox bg-fc7470"></i> 61-90天</p></td>
                  <td>{{feedback_lifetime_overviewData_C.item_quantity | numberThousand}}</td>
                  <td>{{feedback_lifetime_overviewData_C.quantity_ratio | numberPercent}}</td>
                  <td>{{feedback_lifetime_overviewData_C.item_value | numberThousand}}</td>
                  <td>{{feedback_lifetime_overviewData_C.value_ratio | numberPercent}}</td>
                </tr>
                <tr>
                  <td><p class="yx-iboxP"><i class="yx-ibox bg-56b5f1"></i> 90天以上</p></td>
                  <td>{{feedback_lifetime_overviewData_D.item_quantity | numberThousand}}</td>
                  <td>{{feedback_lifetime_overviewData_D.quantity_ratio | numberPercent}}</td>
                  <td>{{feedback_lifetime_overviewData_D.item_value | numberThousand}}</td>
                  <td>{{feedback_lifetime_overviewData_D.value_ratio | numberPercent}}</td>
                </tr>
              </table>
            </div>
          </div>
          <div class="yx-marginTop40 loadingBox">
            <div class="loadding80" v-show="lifetime_overviewIsLoading"></div>
            <div class="frame-noData" v-show="lifetime_overviewIsError">暂无数据...</div>
          </div>

          <!--
                  <div class="yx-marginTop40 yx-select-change yx-fontSize18">
                    <span class="yx-marginRight5">库龄</span>
                    <select name="" id="">
                      <option value="">2017年第四季度</option>
                    </select>
                    <span class="yx-marginRight5">物料编号</span>
                    <select name="" id="">
                      <option value="">2017年第四季度</option>
                    </select>
                  </div>
          -->

          <table class="yx-table yx-marginTop24 yx-widthP100"
                 v-show="!lifetimeCategoryIsLoading&&!lifetimeCategoryIsError">
            <tr>
              <th>物料</th>
              <th>描述</th>
              <th>类型</th>
              <th>时间</th>
              <th>数量</th>
              <th>库龄</th>
              <th>平均日库存数量</th>
              <th>平均日需求数量</th>
              <th>平均可供应天数</th>
              <th>平均日库存价值</th>
            </tr>
            <tr v-for="item in feedback_lifetime_categoryData.items">
              <td>{{item.SEGMENT1}}</td>
              <td>{{item.DESCRIPTION}}</td>
              <td>{{item.CATEGORY}}</td>
              <td>{{item.TRANSACTION_DATE | date10Filter}}</td>
              <td>{{item.QUANTITY|numberThousand}}</td>
              <td>{{item.LIFE_TIME | numberThousand}}</td>
              <td>{{item.INVENTORY_QUANTITY | numberThousand}}</td>
              <td>{{item.OUTPUT_QUANTITY | numberThousand}}</td>
              <td>{{item.DOS | numberThousand}}</td>
              <td>{{item.VALUE | numberThousand}}</td>
            </tr>
          </table>
          <div class="table-tr" v-if="!lifetimeCategoryIsLoading&&!lifetimeCategoryIsError&&feedback_lifetime_categoryData.pages>1">
            <div class="pageturn">
              共
              <em>{{feedback_lifetime_categoryData.total}}</em>
              条，第
              <em>{{feedback_lifetime_categoryData.page}}</em>
              /
              <em>{{feedback_lifetime_categoryData.pages}}</em>
              页，跳转到第
              <input type="text" class="pageturn-ipt" v-model="iptPage1" value=""/>
              页
              <span class="page-turn"
                    v-on:click="feedback_lifetime_categoryFun(iptPage1,feedback_lifetime_categoryData.page)">跳转</span>
              <span class="page-first"
                    v-on:click="feedback_lifetime_categoryFun(1,feedback_lifetime_categoryData.page)">首页</span>
              <span class="page-up"
                    v-on:click="feedback_lifetime_categoryData.page>1?feedback_lifetime_categoryFun(feedback_lifetime_categoryData.page-1,feedback_lifetime_categoryData.page):1">上一页</span>
              <span class="page-down"
                    v-on:click="feedback_lifetime_categoryData.page<feedback_lifetime_categoryData.pages?feedback_lifetime_categoryFun(feedback_lifetime_categoryData.page+1,feedback_lifetime_categoryData.page):''">下一页</span>
              <span class="page-last"
                    v-on:click="feedback_lifetime_categoryFun(feedback_lifetime_categoryData.pages,feedback_lifetime_categoryData.page)">末页</span>
            </div>
          </div>
          <div class="yx-marginTop40 loadingBox">
            <div class="loadding80" v-show="lifetimeCategoryIsLoading"></div>
            <div class="frame-noData" v-show="lifetimeCategoryIsError">暂无数据...</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  import calender from '../common/js/calenderMonth';
  import common from '../common/js/common';

  var echarts = require('echarts');
  export default {
    watch: {
      itemClassSelectVal: function () {
        if (this.itemClassSelectVal == '按供应商类别筛选') {
          this.itemCategory();
        } else {
          this.itemCategory();//需要改动，模糊搜索
        }
      },
      query_get_item_big_class_input: function () {//大类
        if (this.query_get_item_big_class_input == '') {
          this.query_get_item_big_class_input_delete = false;
          this.disabledInput = true;
        } else {
          this.query_get_item_big_class_input_delete = true;
          this.disabledInput = false;
        }
        this.query_get_item_big_classFun();
      },
      query_get_item_small_class_input: function () {//小类
        if (this.query_get_item_small_class_input == '') {
          this.query_get_item_small_class_input_delete = false;
        } else {
          this.query_get_item_small_class_input_delete = true;
        }
        this.query_get_item_small_classFun();
      },
      query_get_item_input: function () {//物料编号
        if (this.query_get_item_input == '') {
          this.query_get_item_input_delete = false;
        } else {
          this.query_get_item_input_delete = true;
        }
        this.query_get_itemFun();
      },
      query_get_plan_class_input: function () {//计划类别
        if (this.query_get_plan_class_input == '') {
          this.query_get_plan_class_input_delete = false;
        } else {
          this.query_get_plan_class_input_delete = true;
        }
      },
      query_get_item_category_input: function () {
        if (this.query_get_item_category_input == '') {
          this.query_get_item_category_input_delete = false;
        } else {
          this.query_get_item_category_input_delete = true;
        }
      },
      query_get_buyer_input: function () {//采购员
        if (this.query_get_buyer_input == '') {
          this.query_get_buyer_input_delete = false;
        } else {
          this.query_get_buyer_input_delete = true;
        }
        this.query_get_buyerFun();
      },
      query_get_sourcing_input: function () {//sourcing
        if (this.query_get_sourcing_input == '') {
          this.query_get_sourcing_input_delete = false;
        } else {
          this.query_get_sourcing_input_delete = true;
        }
        this.query_get_sourcingFun()
      },
      query_get_planner_input: function () {//计划员
        if (this.query_get_planner_input == '') {
          this.query_get_planner_input_delete = false;
        } else {
          this.query_get_planner_input_delete = true;
        }
        this.query_get_plannerFun()
      },
    },
    mounted() {
     /* this.query_get_item_big_classFun();//库存大类
      this.query_get_itemFun();//物料编号
      this.query_get_buyerFun();//采购员
      this.query_get_sourcingFun();//sourcing
      this.query_get_plannerFun();//计划员

      this.query_get_plan_classFun();//计划类别*/
      this.query_get_item_categoryFun();//智能分类
      this.queryFun();
      common.selectDate1('#startDate');
      common.selectDate1('#endDate');
    },
    data() {
      return {
        tableTrClick:-1,
        showDate1:false,
        showDate2:false,
        configShow: 1,
        numFix1: common.tofixeds,
        disabledInput: true,
        isActive: true,
        colorList: [
          '#1fbb61', '#ffbe4c', '#fc7470', '#56b5f1', '#837df5', '#1acfc9', '#d275f4'
        ],
        optionPie: {
          tooltip: {
            trigger: 'item',
            formatter: "{a} <br/>{b} : {c} ({d}%)",
            confine: true
          },
          color: ['#ffbe4c', '#fc7470', '#56b5f1', '#51d489'],
          series: {
            name: '供应商分类占比',
            type: 'pie',
            radius: '90%',
            center: ['50%', '50%'],
            label: {
              normal: {
                show: false
              }
            },
            data: [
              {value: [], name: 'I类'},
              {value: [], name: 'II类'},
              {value: [], name: 'III类'},
            ],
            itemStyle: {
              normal: {
                borderWidth: 1,
                borderColor: 'white'
              },
              emphasis: {
                shadowBlur: 5,
                shadowOffsetX: 0,
                shadowColor: 'rgba(0, 0, 0, 0.5)'
              }
            }
          }
        },
        optionBarLine: {
          tooltip: {
            trigger: 'axis',
            /* formatter: function (params) {
               var paramsItem='';
               for(var i=0;i<params.length;i++){
                 paramsItem=paramsItem+params[i].seriesName + '：' + params[i].data[1].toFixed(2)+'</br>'
               }
               return (params[0].data[0]+'</br>'+paramsItem)
             },*/
          },
          legend: {
            data: []
          },
          grid: {
            show: true,
            top: '50',
            left: '4%',
            right: '4%',
            bottom: '50',
            /*backgroundColor:'#fafafa',*/
            borderWidth: 0
          },
          dataZoom: [{
            show: true,
            height: 20,
            xAxisIndex: [0],
            bottom: 0,
            start: 0,
            end: 100,
            handleIcon: 'path://M306.1,413c0,2.2-1.8,4-4,4h-59.8c-2.2,0-4-1.8-4-4V200.8c0-2.2,1.8-4,4-4h59.8c2.2,0,4,1.8,4,4V413z',
            handleSize: '110%',
            handleStyle: {
              color: "#d3dee5",

            },
            textStyle: {
              color: "#fff"
            },
            borderColor: "#90979c"
          }, {
            type: 'inside',
            show: true,
            height: 15,
            start: 1,
            end: 35
          }],
          xAxis: {
            type: 'category',
            data: [],
            name: '时间',
          },
          yAxis: [{
            name: '',
            type: 'value',
            splitLine: {
              lineStyle: {
                color: '#eee'
              }
            },
            axisLabel: {
              /*formatter:function(v){
                return $scope.allFun.wan(v);
              }*/
            }
          }],
          series: []
        },
        selectListName: [
          'query_get_item_big_class',
          'query_get_item_small_class',
          'query_get_item',
          'query_get_plan_class',
          'query_get_item_category',
          'query_get_buyer',
          'query_get_sourcing',
          'query_get_planner',
          'query_get_vendor'
        ],
        certainItem:'all',
        certainItemName:'全部物料',

        query_get_item_big_class: false,
        query_get_item_big_class_input: '',
        query_get_item_big_class_input_id: '',
        query_get_item_big_class_input_boss: '',
        query_get_item_big_class_input_delete: false,
        query_get_item_big_classData: [],//下拉框--库存大类

        query_get_item_small_class: false,
        query_get_item_small_class_input: '',
        query_get_item_small_class_input_id: '',
        query_get_item_small_class_input_boss: '',
        query_get_item_small_class_input_delete: false,
        query_get_item_small_classData: [],//下拉框--库存小类

        query_get_item: false,
        query_get_item_input: '',
        query_get_item_input_id: '',
        query_get_item_input_boss: '',
        query_get_item_input_delete: false,
        query_get_itemData: [],//下拉框--物料编号

        query_get_plan_class: false,
        query_get_plan_class_input: '',
        query_get_plan_class_input_id: '',
        query_get_plan_class_input_boss: '',
        query_get_plan_class_input_delete: false,
        query_get_plan_classData: [],//下拉框--计划类别

        query_get_item_category: false,
        query_get_item_category_input: '',
        query_get_item_category_input_id: '',
        query_get_item_category_input_boss: '',
        query_get_item_category_input_delete: false,
        query_get_item_categoryData: [],//下拉框--智能分类

        query_get_buyer: false,
        query_get_buyer_input: '',
        query_get_buyer_input_id: '',
        query_get_buyer_input_boss: '',
        query_get_buyer_input_delete: false,
        query_get_buyerData: [],//下拉框--采购员

        query_get_sourcing: false,
        query_get_sourcing_input: '',
        query_get_sourcing_input_id: '',
        query_get_sourcing_input_boss: '',
        query_get_sourcing_input_delete: false,
        query_get_sourcingData: [],//下拉框--sourcing

        query_get_planner: false,
        query_get_planner_input: '',
        query_get_planner_input_id: '',
        query_get_planner_input_boss: '',
        query_get_planner_input_delete: false,
        query_get_plannerData: [],//下拉框--计划员
        condition_startDate:'',
        condition_endDate:'',

        feedback_item_queryData: {},
        feedback_inventory_queryData: {},//日均库存图数据
        feedback_fullfillment_queryData: [],
        feedback_turnover_queryData: [],
        feedback_lifetime_overviewData: [],//库龄分析图数据
        feedback_lifetime_overviewData_A: {},
        feedback_lifetime_overviewData_B: {},
        feedback_lifetime_overviewData_C: {},
        feedback_lifetime_overviewData_D: {},
        feedback_lifetime_categoryData: [],//库龄分析表数据
        itemqueryIsLoading: true,
        itemqueryIsError: false,
        feedbackInventoryIsLoading: true,
        feedbackInventoryIsError: false,
        fullfillmentIsLoading: true,
        fullfillmentIsError: false,
        turnoverIsLoading: true,
        turnoverIsError: false,
        lifetimeIsLoading: true,
        lifetimeIsError: false,
        opoIsLoading: true,
        opoIsError: false,
        lifetime_overviewIsLoading: true,
        lifetime_overviewIsError: false,
        lifetimeCategoryIsLoading: true,
        lifetimeCategoryIsError: false,
        iptPage: 1,
        iptPage1: 1,
        firstTime:true,
      }
    },
    methods: {
      feedback_item_query_TR:function(index,id,name){
        if(this.tableTrClick!=index){
          this.tableTrClick=index;
          this.certainItem=id;
          this.certainItemName=name;
        }else{
          this.certainItem='all';
          this.certainItemName='全部物料';
          this.tableTrClick=!this.tableTrClick;
        }
        this.chooseItem();
      },
      setDateList: function (date) {
        /*return common.setDateList(x)*/
        for (var i = 0; i < date.length; i++) {
          date[i] = date[i].substr(0, 10);
        }
        return date;
      },
      /*置空*/
      clearCondition: function () {
        this.tableTrClick=-1;
        this.query_get_item_big_class_input = '';
        this.query_get_item_small_class_input = '';
        this.query_get_item_input='';
        this.query_get_plan_class_input='';
        this.query_get_item_category_input='';
        this.query_get_buyer_input = '';
        this.query_get_sourcing_input = '';
        this.query_get_planner_input = '';

        this.query_get_item_big_class_input_id = '';
        this.query_get_item_small_class_input_id = '';
        this.query_get_item_input_id='';
        this.query_get_plan_class_input_id='';
        this.query_get_item_category_input_id='';
        this.query_get_buyer_input_id = '';
        this.query_get_sourcing_input_id = '';
        this.query_get_planner_input_id = '';

        this.query_get_item_big_class_input_boss = '';
        this.query_get_item_small_class_input_boss = '';
        this.query_get_item_input_boss='';
        this.query_get_plan_class_input_boss='';
        this.query_get_item_category_input_boss='';
        this.query_get_buyer_input_boss = '';
        this.query_get_sourcing_input_boss = '';
        this.query_get_planner_input_boss = '';

        $('#startDate').prev('.ipt-clear').hide();
        $('#endDate').prev('.ipt-clear').hide();
        $('#startDate').attr("date","");
        $('#startDate').val('');
        $('#endDate').attr("date","");
        $('#endDate').val('');
        this.condition_startDate='';
        this.condition_endDate='';
      },
      selectClick: function (x) {
        var _self = this;
        var funName = x + 'Fun';
        if(x=='query_get_item_category'){

        }else{
          _self[funName]();
        }
        for (var i = 0; i < _self.selectListName.length; i++) {
          var yy = _self.selectListName[i];
          yy == x ? _self[x] = !_self[x] : _self[yy] = false;
        }
      },
      selectSlideUp2: function () {
        var _self = this;
        for (var i = 0; i < _self.selectListName.length; i++) {
          var yx = _self.selectListName[i];
          _self[yx] = false;
        }
      },
      /*下拉框--库存大类*/
      query_get_item_big_classFun: function () {
        var _self = this;
        var yx_data = {
          "dim": this.query_get_item_big_class_input.indexOf(' ')>-1?this.query_get_item_big_class_input.split(' ')[1]:this.query_get_item_big_class_input
        }
        common.getData(-1,common.url_constitute.query_get_item_big_class, "post", yx_data, function (d) {
          if (d.data.code == 1024) {
            _self.query_get_item_big_classData = d.data.result;
          }
        })
      },
      /*下拉框--库存大类--选择*/
      choose_get_item_big_classFun: function (name, num) {
        this.query_get_item_big_class_input = num+' '+name;
        this.query_get_item_big_class_input_id=num;
        this.selectSlideUp2();
        this.query_get_item_small_classFun();
      },
      /*下拉框--库存小类*/
      query_get_item_small_classFun: function () {
        var _self = this;
        var yx_data = {
          "big_class": this.query_get_item_big_class_input.indexOf(' ')>-1?this.query_get_item_big_class_input.split(' ')[0]:this.query_get_item_big_class_input,
          "dim": this.query_get_item_small_class_input.indexOf(' ')>-1?this.query_get_item_small_class_input.split(' ')[1]:this.query_get_item_small_class_input
        }
        common.getData(-1,common.url_constitute.query_get_item_small_class, "post", yx_data, function (d) {
          if (d.data.code == 1024) {
            _self.query_get_item_small_classData = d.data.result;
          }
        })
      },
      /*下拉框--库存小类--选择*/
      choose_get_item_small_classFun: function (name, num) {
        this.query_get_item_small_class_input = num+' '+name;
        this.query_get_item_small_class_input_id=num;
        this.selectSlideUp2();
        this.query_get_itemFun();
      },
      /*下拉框--物料编号*/
      query_get_itemFun: function () {
        var _self = this;
        var yx_data = {
          "big_class": this.query_get_item_big_class_input.indexOf(' ')>-1?this.query_get_item_big_class_input.split(' ')[0]:this.query_get_item_big_class_input,
          "small_class": this.query_get_item_small_class_input.indexOf(' ')>-1?this.query_get_item_small_class_input.split(' ')[0]:this.query_get_item_small_class_input,
          "dim": this.query_get_item_input
        }
        common.getData(-1,common.url_constitute.query_get_item, "post", yx_data, function (d) {
          if (d.data.code == 1024) {
            _self.query_get_itemData = d.data.result;
          }
        })
      },
      /*下拉框--物料编号--选择*/
      choose_get_itemFun: function (name,num) {
        this.query_get_item_input = name;
        this.query_get_item_input_id=num;
        this.selectSlideUp2();
      },
      /*下拉框--计划类别*/
      query_get_plan_classFun: function () {
        var _self = this;
        var yx_data = {};
        common.getData(-1,common.url_constitute.query_get_plan_class, "post", yx_data, function (d) {
          if (d.data.code == 1024) {
            _self.query_get_plan_classData = d.data.result;
          }
        })
      },
      /*下拉框--计划类别--选择*/
      choose_get_plan_classFun: function (name, num) {
        this.query_get_plan_class_input = name;
        this.query_get_plan_class_input_id=num;
        this.selectSlideUp2();
      },
      /*下拉框--智能分类*/
      query_get_item_categoryFun: function () {
        var _self = this;
        var yx_data = {
          "dim": this.query_get_item_category_input == '' ? '' : this.query_get_item_category_input,
        };
        common.getData(-1,common.url_constitute.query_get_item_category, "post", yx_data, function (d) {
          if (d.data.code == 1024) {
            _self.query_get_item_categoryData = d.data.result;
          }
        })
      },
      /*下拉框--智能分类--选择*/
      choose_query_get_item_categoryFun: function (name,num) {
        this.query_get_item_category_input = name;
        this.query_get_item_category_input_id=num;
        this.selectSlideUp2();
      },
      /*下拉框--采购员*/
      query_get_buyerFun: function () {
        var _self = this;
        var yx_data = {
          "dim": this.query_get_buyer_input.indexOf(' ')>-1?this.query_get_buyer_input.split(' ')[1]:this.query_get_buyer_input,
        };
        common.getData(-1,common.url_constitute.query_get_buyer, "post", yx_data, function (d) {
          if (d.data.code == 1024) {
            _self.query_get_buyerData = d.data.result;
          }
        })
      },
      /*下拉框--采购员--选择*/
      choose_query_get_buyerFun: function (name, num) {
        this.query_get_buyer_input = num+' '+name;
        this.query_get_buyer_input_id=num;
        this.selectSlideUp2();
      },
      /*下拉框--sourcing*/
      query_get_sourcingFun: function () {
        var _self = this;
        var yx_data = {
          "dim": this.query_get_sourcing_input.indexOf(' ')>-1 ?this.query_get_sourcing_input.split(' ')[1]:this.query_get_sourcing_input,
        };
        common.getData(-1,common.url_constitute.query_get_sourcing, 'post', yx_data, function (d) {
          if (d.data.code == 1024) {
            _self.query_get_sourcingData = d.data.result;
          }
        });
      },
      /*下拉框--sourcing--选择*/
      choose_query_get_sourcingFun: function (name, num) {
        this.query_get_sourcing_input = num+' '+name;
        this.query_get_sourcing_input_id=num;
        this.selectSlideUp2();
      },
      /*下拉框--计划员*/
      query_get_plannerFun: function () {
        var _self = this;
        var yx_data = {
          "dim": this.query_get_planner_input.indexOf(' ')>-1 ? this.query_get_planner_input.split(' ')[1]:this.query_get_planner_input,
        };
        common.getData(-1,common.url_constitute.query_get_planner, 'post', yx_data, function (d) {
          if (d.data.code == 1024) {
            _self.query_get_plannerData = d.data.result;
          }
        })
      },
      /*下拉框--计划员--选择*/
      choose_query_get_plannerFun: function (name, num) {
        this.query_get_planner_input = num+' '+name;
        this.query_get_planner_input_id=num;
        this.selectSlideUp2();
      },
      /*INPUT自带的×*/
      inputClear:function(who){
        var _self=this;
        _self[who]='';
        var whoID=who+'_id';
        _self[whoID]='';
      },

      clearDate1:function(){
        $('#startDate').attr("date","");
        $('#startDate').val('');
        this.condition_startDate='';
      },
      clearDate2:function(){
        $('#endDate').attr("date","");
        $('#endDate').val('');
        this.condition_endDate='';
      },
      queryFun: function () {
        this.query_get_item_big_class_input_boss=this.query_get_item_big_class_input_id;
        this.query_get_item_small_class_input_boss=this.query_get_item_small_class_input_id;
        this.query_get_item_input_boss=this.query_get_item_input_id;
        this.query_get_plan_class_input_boss=this.query_get_plan_class_input_id;
        this.query_get_item_category_input_boss=this.query_get_item_category_input_id;
        this.query_get_buyer_input_boss=this.query_get_buyer_input_id;
        this.query_get_sourcing_input_boss=this.query_get_sourcing_input_id;
        this.query_get_planner_input_boss=this.query_get_planner_input_id;
        this.condition_startDate=$('#startDate').attr("date");
        this.condition_endDate=$('#endDate').attr("date");

        this.firstTime=true;
        this.certainItem='all';
        this.certainItemName='全部物料';
        this.feedback_item_queryFun();
        if(this.configShow==1){
          this.feedback_inventory_queryFun();
        }else if(this.configShow==2){
          this.feedback_fullfillment_queryFun();
        }else if(this.configShow==3){
          this.feedback_turnover_queryFun();
        }else if(this.configShow==4){
          this.feedback_lifetime_queryFun();
        }else if(this.configShow==5){
          this.feedback_opo_queryFun();
        }else{
          this.feedback_lifetime_overviewFun();
          this.feedback_lifetime_categoryFun();
        }
      },
      chooseItem:function(){
        if(this.configShow==1){
          this.feedback_inventory_queryFun();
        }else if(this.configShow==2){
          this.feedback_fullfillment_queryFun();
        }else if(this.configShow==3){
          this.feedback_turnover_queryFun();
        }else if(this.configShow==4){
          this.feedback_lifetime_queryFun();
        }else if(this.configShow==5){
          this.feedback_opo_queryFun();
        }else{
          this.feedback_lifetime_overviewFun();
          this.feedback_lifetime_categoryFun();
        }
      },
      /*智能反馈--item表数据*/
      feedback_item_queryFun: function (page, oldPage) {
        var _self = this;
        _self.itemqueryIsLoading = true;
        if (typeof page == "undefined") {
          page = 1;
        }
        if (page != oldPage) {
          var yx_data = {
            "category": this.query_get_item_category_input_boss,
            "item": this.query_get_item_input_boss,
            "plan_class": this.query_get_plan_class_input_boss,
            "sourcing": this.query_get_sourcing_input_boss,
            "item_big_class": this.query_get_item_big_class_input_boss,
            "item_small_class": this.query_get_item_small_class_input_boss,
            "planner": this.query_get_planner_input_boss,
            "buyer": this.query_get_buyer_input_boss,
            "start_date": this.condition_startDate,
            "end_date": this.condition_endDate,
            page: page
          }
          common.getData(0,common.url_constitute.feedback_item_query, 'post', yx_data, function (d) {
            _self.itemqueryIsLoading = false;
            if (d.data.code == 1024) {
              _self.feedback_item_queryData = d.data.item_dst;
              if(_self.feedback_item_queryData.total<1){
                _self.itemqueryIsError = true;
              }else{
                _self.itemqueryIsError = false;
              }
            }else if(d.data.code==9007){
              _self.itemqueryIsError = true;
            }
          })
        }
      },
      /*智能反馈--日均库存--feedback_inventory_query*/
      feedback_inventory_queryFun: function () {
        var _self = this;
        _self.feedbackInventoryIsLoading = true;
        var yx_data = {
          "category": this.query_get_item_category_input_boss,
          "plan_class": this.query_get_plan_class_input_boss,
          "sourcing": this.query_get_sourcing_input_boss,
          "item_big_class": this.query_get_item_big_class_input_boss,
          "item_small_class": this.query_get_item_small_class_input_boss,
          "planner": this.query_get_planner_input_boss,
          "buyer": this.query_get_buyer_input_boss,

          "item": this.certainItem,
          "start_date": this.condition_startDate,
          "end_date": this.condition_endDate,
        }
        common.getData(1,common.url_constitute.feedback_inventory_query, 'post', yx_data, function (d) {
          _self.feedbackInventoryIsLoading = false;
          if (d.data.code == 1024) {
            _self.feedback_inventory_queryData = d.data.inventory_contrast_dst;
            if(_self.feedback_inventory_queryData.TRANSACTION_DATE.length<1){
              _self.feedbackInventoryIsError = true;
            }else{
              _self.feedbackInventoryIsError = false;
              var optionFeedbackInventoryQuery = {
                tooltip: {
                  trigger: 'axis',
                  formatter: function (params) {
                    var tpl = '';
                    tpl = params[0].axisValue;
                    for (var i = 0; i < params.length; i++) {
                      tpl = tpl + '<br/>' + params[i].marker + params[i].seriesName + '：' + common.numThousand(params[i].value)
                    }
                    return tpl
                  }
                },
                legend: {
                  data: ["优化模型金额", '实际金额', '优化模型数量', '实际数量']
                },
                grid: {
                  show: true,
                  top: '50',
                  left: '4%',
                  right: '4%',
                  bottom: '50',
                  borderWidth: 0
                },
                dataZoom: [{
                  show: true,
                  height: 20,
                  xAxisIndex: [0],
                  bottom: 0,
                  start: 0,
                  end: 100,
                  handleIcon: 'path://M306.1,413c0,2.2-1.8,4-4,4h-59.8c-2.2,0-4-1.8-4-4V200.8c0-2.2,1.8-4,4-4h59.8c2.2,0,4,1.8,4,4V413z',
                  handleSize: '110%',
                  handleStyle: {
                    color: "#d3dee5",

                  },
                  textStyle: {
                    color: "#fff"
                  },
                  borderColor: "#90979c"
                }, {
                  type: 'inside',
                  show: true,
                  height: 15,
                  start: 1,
                  end: 35
                }],
                xAxis: {
                  type: 'category',
                  data: common.setDateMonList(_self.feedback_inventory_queryData.TRANSACTION_DATE),
                  name: '时间',
                },
                yAxis: [{
                  name: '金额/元',
                  type: 'value',
                  splitLine: {
                    show: false,
                    lineStyle: {
                      color: '#eee'
                    }
                  },
                  axisLabel: {
                    formatter:function(v){
                      return common.wan(v);
                    }
                  }
                },{
                  type: 'value',
                  name: '数量',
                  splitLine: {
                    show: false,
                  },
                  axisLabel: {
                    formatter:function(v){
                      return common.wan(v);
                    }
                  }
                }],
                series: []
              };
              var seriesFeedbackInventoryQuery = [{
                name: '优化模型数量',
                type: 'line',
                itemStyle: {
                  normal: {
                    color: '#1fbb61'
                  }
                },
                yAxisIndex: 1,
                data: _self.feedback_inventory_queryData.PREDICT_QUANTITY
              }, {
                name: '实际数量',
                type: 'line',
                itemStyle: {
                  normal: {
                    color: '#ffbe4c'
                  }
                },
                yAxisIndex: 1,
                data: _self.feedback_inventory_queryData.ACTUAL_QUANTITY
              }, {
                name: '优化模型金额',
                type: 'line',
                itemStyle: {
                  normal: {
                    color: '#fc7470'
                  }
                },
                data: _self.feedback_inventory_queryData.PREDICT_VALUE
              }, {
                name: '实际金额',
                type: 'line',
                itemStyle: {
                  normal: {
                    color: '#56b5f1'
                  }
                },
                data: _self.feedback_inventory_queryData.ACTUAL_VALUE
              }]
              optionFeedbackInventoryQuery.series = seriesFeedbackInventoryQuery;
              var containerFeedbackInventoryQuery = echarts.init(document.getElementById('container_feedbackInventoryQuery'));
              containerFeedbackInventoryQuery.setOption(optionFeedbackInventoryQuery,true);
              window.addEventListener("resize",function(){
                containerFeedbackInventoryQuery.resize();
              })
            }
          }else if(d.data.code==9007){
            _self.feedbackInventoryIsError = true;
          }
        })
      },
      /*智能反馈--需求满足率--feedback_fullfillment_query*/
      feedback_fullfillment_queryFun: function () {
        var _self = this;
        _self.fullfillmentIsLoading = true;
        var yx_data = {
          "category": this.query_get_item_category_input_boss,
          "plan_class": this.query_get_plan_class_input_boss,
          "sourcing": this.query_get_sourcing_input_boss,
          "item_big_class": this.query_get_item_big_class_input_boss,
          "item_small_class": this.query_get_item_small_class_input_boss,
          "planner": this.query_get_planner_input_boss,
          "buyer": this.query_get_buyer_input_boss,

          "item": this.certainItem,
          "start_date": this.condition_startDate,
          "end_date": this.condition_endDate,
        }
        common.getData(2,common.url_constitute.feedback_fullfillment_query, 'post', yx_data, function (d) {
          _self.fullfillmentIsLoading = false;
          if (d.data.code == 1024) {
            _self.feedback_fullfillment_queryData = d.data.fullfillment_dst;
            if(_self.feedback_fullfillment_queryData.transaction_date.length<1){
              _self.fullfillmentIsError = true;
            }else{
              _self.fullfillmentIsError = false;
              var optionFullfillment = {
                tooltip: {
                  trigger: 'axis',
                  formatter: function (params) {
                    var tpl = '';
                    tpl = params[0].axisValue;
                    for (var i = 0; i < params.length; i++) {
                      tpl = tpl + '<br/>' + params[i].marker + params[i].seriesName + '：' + common.numThousand(params[i].value * 100) + '%'
                    }
                    return tpl
                  }
                },
                legend: {
                  data: ['实际满足率', '优化模型满足率'],
                },
                grid: {
                  show: true,
                  top: '50',
                  left: '4%',
                  right: '4%',
                  bottom: '50',
                  /*backgroundColor:'#fafafa',*/
                  borderWidth: 0
                },
                dataZoom: [{
                  show: true,
                  height: 20,
                  xAxisIndex: [0],
                  bottom: 0,
                  start: 0,
                  end: 100,
                  handleIcon: 'path://M306.1,413c0,2.2-1.8,4-4,4h-59.8c-2.2,0-4-1.8-4-4V200.8c0-2.2,1.8-4,4-4h59.8c2.2,0,4,1.8,4,4V413z',
                  handleSize: '110%',
                  handleStyle: {
                    color: "#d3dee5",

                  },
                  textStyle: {
                    color: "#fff"
                  },
                  borderColor: "#90979c"
                }, {
                  type: 'inside',
                  show: true,
                  height: 15,
                  start: 1,
                  end: 35
                }],
                xAxis: {
                  type: 'category',
                  data: common.setDateMonList(_self.feedback_fullfillment_queryData.transaction_date),
                  name: '时间',
                },
                yAxis: [{
                  name: '百分比',
                  type: 'value',
                  splitLine: {
                    lineStyle: {
                      color: '#eee'
                    }
                  },
                  axisLabel: {
                    formatter: function (params) {
                      params = params * 100 + '%';
                      return params
                    }
                  }
                }],
                series: []
              };
              optionFullfillment.series = [{
                name: '实际满足率',
                type: 'line',
                itemStyle: {
                  normal: {
                    color: '#1fbb61'
                  }
                },
                data: _self.feedback_fullfillment_queryData.actual_fullfillment
              }, {
                name: '优化模型满足率',
                type: 'line',
                itemStyle: {
                  normal: {
                    color: '#56b5f1'
                  }
                },
                data: _self.feedback_fullfillment_queryData.predict_fullfullment
              }];
              var containerFullfillment = echarts.init(document.getElementById('container_fullfillment'));
              containerFullfillment.setOption(optionFullfillment,true);
              window.addEventListener("resize",function(){
                containerFullfillment.resize();
              })
            }
          }else if(d.data.code==9007){
            _self.fullfillmentIsError = true;
          }
        })
      },
      /*智能反馈--年周转率--feedback_turnover_query*/
      feedback_turnover_queryFun: function () {
        var _self = this;
        _self.turnoverIsLoading = true;
        var yx_data = {
          "category": this.query_get_item_category_input_boss,
          "plan_class": this.query_get_plan_class_input_boss,
          "sourcing": this.query_get_sourcing_input_boss,
          "item_big_class": this.query_get_item_big_class_input_boss,
          "item_small_class": this.query_get_item_small_class_input_boss,
          "planner": this.query_get_planner_input_boss,
          "buyer": this.query_get_buyer_input_boss,

          "item": this.certainItem,
          "start_date": this.condition_startDate,
          "end_date": this.condition_endDate,
        }
        common.getData(3,common.url_constitute.feedback_turnover_query, 'post', yx_data, function (d) {
          _self.turnoverIsLoading = false;
          if (d.data.code == 1024) {
            _self.feedback_turnover_queryData = d.data.predict_turnover_dst;
            if(_self.feedback_turnover_queryData.TRANSACTION_DATE.length<1){
              _self.turnoverIsError = true;
            }else{
              _self.turnoverIsError = false;
              var optionTurnover = {
                tooltip: {
                  trigger: 'axis',
                  formatter: function (params) {
                    var tpl = '';
                    tpl = params[0].axisValue;
                    for (var i = 0; i < params.length; i++) {
                      tpl = tpl + '<br/>' + params[i].marker + params[i].seriesName + '：' + common.numThousand(params[i].value)
                    }
                    return tpl
                  }
                },
                legend: {
                  data:  ['实际周转率', '优化模型周转率']
                },
                grid: {
                  show: true,
                  top: '50',
                  left: '4%',
                  right: '4%',
                  bottom: '50',
                  borderWidth: 0
                },
                dataZoom: [{
                  show: true,
                  height: 20,
                  xAxisIndex: [0],
                  bottom: 0,
                  start: 0,
                  end: 100,
                  handleIcon: 'path://M306.1,413c0,2.2-1.8,4-4,4h-59.8c-2.2,0-4-1.8-4-4V200.8c0-2.2,1.8-4,4-4h59.8c2.2,0,4,1.8,4,4V413z',
                  handleSize: '110%',
                  handleStyle: {
                    color: "#d3dee5",

                  },
                  textStyle: {
                    color: "#fff"
                  },
                  borderColor: "#90979c"
                }, {
                  type: 'inside',
                  show: true,
                  height: 15,
                  start: 1,
                  end: 35
                }],
                xAxis: {
                  type: 'category',
                  data: common.setDateMonList(_self.feedback_turnover_queryData.TRANSACTION_DATE),
                  name: '时间',
                },
                yAxis: [{
                  name: '年周转率',
                  type: 'value',
                  splitLine: {
                    lineStyle: {
                      color: '#eee'
                    }
                  },
                  axisLabel: {
                    formatter: function (params) {
                      params = params.toFixed(2);
                      return params
                    }
                  }
                }],
                series: [{
                  name: '优化模型周转率',
                  type: 'line',
                  itemStyle: {
                    normal: {
                      color: '#1fbb61'
                    }
                  },
                  data: _self.feedback_turnover_queryData.actual_turnover
                }, {
                  name: '实际周转率',
                  type: 'line',
                  itemStyle: {
                    normal: {
                      color: '#56b5f1'
                    }
                  },
                  data: _self.feedback_turnover_queryData.predict_turnover
                }]
              };
              var containerTurnover = echarts.init(document.getElementById('container_turnover'));
              containerTurnover.setOption(optionTurnover,true);
              window.addEventListener("resize",function(){
                containerTurnover.resize();
              })
            }
          }else if(d.data.code==9007){
            _self.turnoverIsError = true;
          }
        })
      },
      /*智能反馈--库龄--feedback_lifetime_query*/
      feedback_lifetime_queryFun: function () {
        var _self = this;
        _self.lifetimeIsLoading = true;
        var yx_data = {
          "category": this.query_get_item_category_input_boss,
          "plan_class": this.query_get_plan_class_input_boss,
          "sourcing": this.query_get_sourcing_input_boss,
          "item_big_class": this.query_get_item_big_class_input_boss,
          "item_small_class": this.query_get_item_small_class_input_boss,
          "planner": this.query_get_planner_input_boss,
          "buyer": this.query_get_buyer_input_boss,

          "item": this.certainItem,
          "start_date": this.condition_startDate,
          "end_date": this.condition_endDate,
        }
        common.getData(4,common.url_constitute.feedback_lifetime_query, 'post', yx_data, function (d) {
          _self.lifetimeIsLoading = false;
          if (d.data.code == 1024) {
            _self.feedback_lifetime_queryData = d.data.lifetime_dst;
            if(_self.feedback_lifetime_queryData.transaction_date.length<1){
              _self.lifetimeIsError = true;
            }else{
              _self.lifetimeIsError = false;
              var optionLifetime = {
                tooltip: {
                  trigger: 'axis',
                  formatter: function (params) {
                    var tpl = '';
                    tpl = params[0].axisValue;
                    for (var i = 0; i < params.length; i++) {
                      tpl = tpl + '<br/>' + params[i].marker + params[i].seriesName + '：' + common.numThousand(params[i].value)
                    }
                    return tpl
                  }
                },
                legend: {
                  data: ['实际库龄', '优化模型库龄']
                },
                grid: {
                  show: true,
                  top: '50',
                  left: '4%',
                  right: '4%',
                  bottom: '50',
                  borderWidth: 0
                },
                dataZoom: [{
                  show: true,
                  height: 20,
                  xAxisIndex: [0],
                  bottom: 0,
                  start: 0,
                  end: 100,
                  handleIcon: 'path://M306.1,413c0,2.2-1.8,4-4,4h-59.8c-2.2,0-4-1.8-4-4V200.8c0-2.2,1.8-4,4-4h59.8c2.2,0,4,1.8,4,4V413z',
                  handleSize: '110%',
                  handleStyle: {
                    color: "#d3dee5",

                  },
                  textStyle: {
                    color: "#fff"
                  },
                  borderColor: "#90979c"
                }, {
                  type: 'inside',
                  show: true,
                  height: 15,
                  start: 1,
                  end: 35
                }],
                xAxis: {
                  type: 'category',
                  data: common.setDateMonList(_self.feedback_lifetime_queryData.transaction_date),
                  name: '时间',
                },
                yAxis: [{
                  name: '天数',
                  type: 'value',
                  splitLine: {
                    lineStyle: {
                      color: '#eee'
                    }
                  },
                  axisLabel: {
                    formatter: function (params) {
                      return common.wan(params);
                    }
                  }
                }],
                series: [{
                  name: '实际库龄',
                  type: 'line',
                  itemStyle: {
                    normal: {
                      color: '#1fbb61'
                    }
                  },
                  data: _self.feedback_lifetime_queryData.actual_life_time
                }, {
                  name: '优化模型库龄',
                  type: 'line',
                  itemStyle: {
                    normal: {
                      color: '#56b5f1'
                    }
                  },
                  data: _self.feedback_lifetime_queryData.predict_lift_time
                }]
              };
              var containerLifetime = echarts.init(document.getElementById('container_lifetime'));
              containerLifetime.setOption(optionLifetime,true);
              window.addEventListener("resize",function(){
                containerLifetime.resize();
              })
            }
          }else if(d.data.code==9007){
            _self.lifetimeIsError = true;
          }
        })
      },
      /*智能反馈-opo--feedback_OPO_query*/
      feedback_opo_queryFun: function () {
        var _self = this;
        _self.opoIsLoading = true;
        var yx_data = {
          "category": this.query_get_item_category_input_boss,
          "plan_class": this.query_get_plan_class_input_boss,
          "sourcing": this.query_get_sourcing_input_boss,
          "item_big_class": this.query_get_item_big_class_input_boss,
          "item_small_class": this.query_get_item_small_class_input_boss,
          "planner": this.query_get_planner_input_boss,
          "buyer": this.query_get_buyer_input_boss,

          "item": this.certainItem,
          "start_date": this.condition_startDate,
          "end_date": this.condition_endDate,
        }
        common.getData(5,common.url_constitute.feedback_opo_query, 'post', yx_data, function (d) {
          _self.opoIsLoading = false;
          if (d.data.code == 1024) {
            _self.feedback_opo_queryData = d.data.opo_contrast_dst;
            if(_self.feedback_opo_queryData.transaction_date.length<1){
              _self.opoIsError = true;
            }else{
              _self.opoIsError = false;
              var optionOPO = {
                tooltip: {
                  trigger: 'axis',
                  formatter: function (params) {
                    var tpl = '';
                    tpl = params[0].axisValue;
                    for (var i = 0; i < params.length; i++) {
                      tpl = tpl + '<br/>' + params[i].marker + params[i].seriesName + '：' + common.numThousand(params[i].value)
                    }
                    return tpl
                  }
                },
                legend: {
                  data: ['实际OPO数量', '优化模型OPO数量', '实际OPO价值', '优化模型OPO价值'],
                },
                grid: {
                  show: true,
                  top: '50',
                  left: '4%',
                  right: '4%',
                  bottom: '50',
                  borderWidth: 0
                },
                dataZoom: [{
                  show: true,
                  height: 20,
                  xAxisIndex: [0],
                  bottom: 0,
                  start: 0,
                  end: 100,
                  handleIcon: 'path://M306.1,413c0,2.2-1.8,4-4,4h-59.8c-2.2,0-4-1.8-4-4V200.8c0-2.2,1.8-4,4-4h59.8c2.2,0,4,1.8,4,4V413z',
                  handleSize: '110%',
                  handleStyle: {
                    color: "#d3dee5",

                  },
                  textStyle: {
                    color: "#fff"
                  },
                  borderColor: "#90979c"
                }, {
                  type: 'inside',
                  show: true,
                  height: 15,
                  start: 1,
                  end: 35
                }],
                xAxis: {
                  type: 'category',
                  data: common.setDateMonList(_self.feedback_opo_queryData.transaction_date),
                  name: '时间',
                },
                yAxis: [{
                  name: '金额',
                  type: 'value',
                  splitLine: {
                    show:false,
                    lineStyle: {
                      color: '#eee'
                    }
                  },
                  axisLabel: {
                    formatter:function(v){
                      return common.wan(v);
                    }
                  }
                },{
                  type: 'value',
                  name: '数量',
                  splitLine: {show: false},
                  axisLabel: {
                    formatter: function (params) {
                      return common.numThousand(params)
                    }
                  }
                }],
                series: [{
                  name: '实际OPO数量',
                  type: 'line',
                  itemStyle: {
                    normal: {
                      color: '#ffbe4c'
                    }
                  },
                  yAxisIndex: 1,
                  data: _self.feedback_opo_queryData.actual_opo
                }, {
                  name: '优化模型OPO数量',
                  type: 'line',
                  itemStyle: {
                    normal: {
                      color: '#51d489'
                    }
                  },
                  yAxisIndex: 1,
                  data: _self.feedback_opo_queryData.predict_opo
                }, {
                  name: '实际OPO价值',
                  type: 'line',
                  itemStyle: {
                    normal: {
                      color: '#fc7470'
                    }
                  },
                  yAxisIndex: 0,
                  data: _self.feedback_opo_queryData.actual_opo_value
                }, {
                  name: '优化模型OPO价值',
                  type: 'line',
                  itemStyle: {
                    normal: {
                      color: '#56b5f1'
                    }
                  },
                  yAxisIndex: 0,
                  data: _self.feedback_opo_queryData.predict_opo_value
                }]
              };
              var containerOPO = echarts.init(document.getElementById('container_OPO'));
              containerOPO.setOption(optionOPO,true);
              window.addEventListener("resize",function(){
                containerOPO.resize();
              })
            }
          }else if(d.data.code==9007){
            _self.opoIsError = true;
          }
        })
      },
      /*智能反馈--库龄图数据--feedback_lifetime_overview*/
      feedback_lifetime_overviewFun: function () {
        var _self = this;
        _self.lifetime_overviewIsLoading = true;
        var yx_data = {
          "category": this.query_get_item_category_input_boss,
          "plan_class": this.query_get_plan_class_input_boss,
          "sourcing": this.query_get_sourcing_input_boss,
          "item_big_class": this.query_get_item_big_class_input_boss,
          "item_small_class": this.query_get_item_small_class_input_boss,
          "planner": this.query_get_planner_input_boss,
          "buyer": this.query_get_buyer_input_boss,

          "item": this.certainItem,
          "start_date": this.condition_startDate,
          "end_date": this.condition_endDate,
        }
        common.getData(6,common.url_constitute.feedback_lifetime_overview, 'post', yx_data, function (d) {
          _self.lifetime_overviewIsLoading = false;
          if (d.data.code == 1024) {
            _self.lifetime_overviewIsError = false;
            _self.feedback_lifetime_overviewData = d.data.item_info;
            _self.feedback_lifetime_overviewData_A = _self.feedback_lifetime_overviewData.A;
            _self.feedback_lifetime_overviewData_B = _self.feedback_lifetime_overviewData.B;
            _self.feedback_lifetime_overviewData_C = _self.feedback_lifetime_overviewData.C;
            _self.feedback_lifetime_overviewData_D = _self.feedback_lifetime_overviewData.D;

            var optionBar={
              tooltip: {
                trigger: 'item',
                  formatter: function(params){
                  return params.seriesName + ":<br />"+
                    params.name+":"+ (params.value*100).toFixed(2)+"%";
                },
                confine: true
              },
              color: ['#ffbe4c', '#51d489', '#fc7470', '#56b5f1'],
                series: {
                name: '价值占比',
                  type: 'pie',
                  radius: '90%',
                  center: ['50%', '50%'],
                  label: {
                  normal: {
                    show: false
                  }
                },
                data: [
                  {value: _self.feedback_lifetime_overviewData_A.value_ratio, name: '30天以下'},
                  {value: _self.feedback_lifetime_overviewData_B.value_ratio, name: '30-60天'},
                  {value: _self.feedback_lifetime_overviewData_C.value_ratio, name: '61-90天'},
                  {value: _self.feedback_lifetime_overviewData_D.value_ratio, name: '90天以上'},
                ],
                  itemStyle: {
                  normal: {
                    borderWidth: 1,
                      borderColor: 'white'
                  },
                  emphasis: {
                    shadowBlur: 5,
                      shadowOffsetX: 0,
                      shadowColor: 'rgba(0, 0, 0, 0.5)'
                  }
                }
              }
            }
            /*var optionBar = {//柱状图
              tooltip: {
                confine: true,
                formatter: function(params){
                  return params.seriesName + ":<br />"+
                    params.name+":"+ common.numThousand(params.value)
                },
              },
              grid: {
                left: '4%',
                right: '0%',
                bottom: '3%',
                top: '17.5%',
                containLabel: true
              },
              xAxis: {
                name: '时间',
                type: 'category',
                data: common.setDateMonList(_self.feedback_lifetime_overviewData.TIME),
                axisLabel: {
                  interval: 0,//横轴信息全部显示
                 /!* rotate: 15*!/
                }
              },
              yAxis: [{
                type: 'value',
                name: '库存金额/元',
                splitLine: {show: false},
                axisLabel: {
                  formatter: function (params) {
                    return common.wan(params);
                  }
                }
              }],
              series: [{
                name: '30天以下',
                type: 'bar',
                barWidth: '65%',
                itemStyle: {
                  normal: {
                    color: '#ffbe4c'
                  }
                },
                stack: '库存',
                data: _self.feedback_lifetime_overviewData_A.value
              }, {
                name: '31-60天',
                type: 'bar',
                barWidth: '65%',
                itemStyle: {
                  normal: {
                    color: '#51d489'
                  }
                },
                stack: '库存',
                data: _self.feedback_lifetime_overviewData_B.value
              }, {
                name: '61-90天',
                type: 'bar',
                barWidth: '65%',
                itemStyle: {
                  normal: {
                    color: '#fc7470'
                  }
                },
                stack: '库存',
                data: _self.feedback_lifetime_overviewData_C.value
              }, {
                name: '90天以上',
                type: 'bar',
                barWidth: '65%',
                itemStyle: {
                  normal: {
                    color: '#56b5f1'
                  }
                },
                stack: '库存',
                data: _self.feedback_lifetime_overviewData_D.value
              }, {
                name: '30天以下',
                type: 'line',
                stack: '总量',
                itemStyle: {
                  normal: {
                    color: '#ffbe4c'
                  }
                },
                lineStyle: {
                  normal: {
                    color: 'rgb(136,136,136)',
                    type: 'dashed'
                  }
                },
                data: _self.feedback_lifetime_overviewData_A.value
              }, {
                name: '31-60天',
                type: 'line',
                stack: '总量',
                itemStyle: {
                  normal: {
                    color: '#51d489'
                  }
                },
                lineStyle: {
                  normal: {
                    color: 'rgb(136,136,136)',
                    type: 'dashed'
                  }
                },
                data: _self.feedback_lifetime_overviewData_B.value
              }, {
                name: '61-90天',
                type: 'line',
                stack: '总量',
                itemStyle: {
                  normal: {
                    color: '#fc7470'
                  }
                },
                lineStyle: {
                  normal: {
                    color: 'rgb(136,136,136)',
                    type: 'dashed'
                  }
                },
                data: _self.feedback_lifetime_overviewData_C.value
              }, {
                name: '90天以上',
                type: 'line',
                stack: '总量',
                itemStyle: {
                  normal: {
                    color: '#56b5f1'
                  }
                },
                lineStyle: {
                  normal: {
                    color: 'rgb(136,136,136)',
                    type: 'dashed'
                  }
                },
                data: _self.feedback_lifetime_overviewData_D.value
              }]
            }*/

            var containerPie = echarts.init(document.getElementById('containerBar'));
            containerPie.setOption(optionBar,true);
            window.addEventListener("resize",function(){
              containerPie.resize();
            })
          } else if(d.data.code==9007) {
            _self.lifetime_overviewIsError = true;
          }
        })
      },
      /*智能反馈--库龄表数据--feedback_lifetime_category*/
      feedback_lifetime_categoryFun: function (page, oldPage) {
        var _self = this;
        _self.lifetimeCategoryIsLoading = true;
        if (typeof page == "undefined") {
          page = 1;
        }
        if (page != oldPage) {
          var yx_data = {
            "category": this.query_get_item_category_input_boss,
            "plan_class": this.query_get_plan_class_input_boss,
            "sourcing": this.query_get_sourcing_input_boss,
            "item_big_class": this.query_get_item_big_class_input_boss,
            "item_small_class": this.query_get_item_small_class_input_boss,
            "planner": this.query_get_planner_input_boss,
            "buyer": this.query_get_buyer_input_boss,

            "item": this.certainItem,
            "start_date": this.condition_startDate,
            "end_date": this.condition_endDate,
            page: page
          }
          common.getData(7,common.url_constitute.feedback_lifetime_category, 'post', yx_data, function (d) {
            _self.lifetimeCategoryIsLoading = false;
            if (d.data.code == 1024) {
              _self.feedback_lifetime_categoryData = d.data.life_time_dst;
              _self.lifetimeCategoryIError = false;
            } else if(d.data.code==9007) {
              _self.lifetimeCategoryIError = true;
            }
          })
        }
      },
    },
  }

</script>

<style>
  @import "../common/css/base.css";
  @import "../common/css/yx.less";
</style>
